module.exports = async (query) => {
    const res = await query(`SHOW TABLES LIKE 'user'`)
    if (!res || res.length === 0) {
        let sql = `CREATE TABLE user (
            id int(11) NOT NULL AUTO_INCREMENT,
            username varchar(255) NOT NULL,
            displayname varchar(255) NOT NULL,
            password varchar(255) NOT NULL,
            email varchar(255) NOT NULL,
            phone varchar(255) NOT NULL,
            PRIMARY KEY (id)
          ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;`
        query(sql,err=>{
            err?console.log("创建用户表失败",err):console.log("创建用户表成功",err)
        })
    }
}
